Skip to content

Conversation

@yowl
Copy link
Collaborator

@yowl yowl commented Aug 20, 2025

This PR adds enough code gen to support the simple-future wit runtime test. As for the async PR, this is pretty much the minimum PR in terms of future support. I've not tackled the typed canonical methods except to add a "void" implementation which is hard coded as the one to use.

Have followed the c test cases rather than the rust ones.

Also changed Export and Import in namespaces to be uppercase and moved resources and other methods to the appropriate import or export class. Some types are still produced from the import side, and have introduced a concept of a bidirectional type (enum, flags) that sit above the import/export split.

The current codegen produced is at https://github.com/yowl/wit-bindgen-simple-future

Move export and import types to respective classes.
Capitilase import and export
Add initial future support
@yowl yowl force-pushed the csharp-future-simple branch from b14b14b to c3fce61 Compare November 30, 2025 16:05
@yowl
Copy link
Collaborator Author

yowl commented Dec 1, 2025

cc @pavelsavara @dicej @jsturtevant

@yowl yowl marked this pull request as ready for review December 1, 2025 19:06
@dicej
Copy link
Collaborator

dicej commented Dec 2, 2025

Thanks for doing this, @yowl! I'm planning to review it by the end of the week.

Copy link
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! Looks like a good start; please see my comments inline.

@yowl
Copy link
Collaborator Author

yowl commented Jan 6, 2026

@dicej Hi, I think I've covered the points from the review now, was a bit of a change for the generic refactoring, sorry about that churn.

Copy link
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for continuing to iterate on this, @yowl, and sorry for the delayed review.

Looks good overall; just a few more comments inline.


public static WaitableSet WaitableSetNew()
{{
var waitable = Interop.WaitableSetNew();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consider naming this waitableSet or handle. The name waitable is a bit confusing since that term means something else in the component model.

void Dispose(bool _disposing)
{
// Free unmanaged resources if any.
vTable.DropReader(Handle);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only call this if Handle != 0

void Dispose(bool _disposing)
{
// Free unmanaged resources if any.
vTable.DropReader(Handle);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only call this if Handle != 0

void Dispose(bool _disposing)
{
// Free unmanaged resources if any.
VTable.DropWriter(Handle);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only call this if Handle != 0.

.collect::<Vec<_>>();
let ty = self.interface_gen.type_name_with_qualifier(ty, true);
//let ty = self.gen.type_name(ty);
//let ty = self.r#gentype_name(ty);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//let ty = self.r#gentype_name(ty);
//let ty = self.interface_gen.type_name(ty);

Or can we just get rid of this line?

@yowl
Copy link
Collaborator Author

yowl commented Jan 8, 2026

I think that's all the latest comments addressed. Thanks for the help!

Copy link
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one more item and this should be good to merge.

@dicej dicej enabled auto-merge January 9, 2026 00:51
@dicej dicej added this pull request to the merge queue Jan 9, 2026
Merged via the queue into bytecodealliance:main with commit a670e8c Jan 9, 2026
27 checks passed
@yowl
Copy link
Collaborator Author

yowl commented Jan 9, 2026

Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants